#pragma once

#include "object/unit.h"
#include "metadata/creature.h"
#include "map/cell.h"

enum RegenStatsFlags
{
    REGEN_FLAG_HEALTH = 0x001,
    REGEN_FLAG_POWER = 0x002,
};

enum CreatureFlagsExtra
{
    CREATURE_FLAG_EXTRA_INSTANCE_BIND = 0x00000001,       // creature kill bind instance with killer and killer's group
    CREATURE_FLAG_EXTRA_NO_AGGRO = 0x00000002,       // not aggro (ignore faction/reputation hostility)
    CREATURE_FLAG_EXTRA_NO_PARRY = 0x00000004,       // creature can't parry
    CREATURE_FLAG_EXTRA_NO_PARRY_HASTEN = 0x00000008,       // creature can't counter-attack at parry
    CREATURE_FLAG_EXTRA_NO_BLOCK = 0x00000010,       // creature can't block
    CREATURE_FLAG_EXTRA_NO_CRUSH = 0x00000020,       // creature can't do crush attacks
    CREATURE_FLAG_EXTRA_NO_XP_AT_KILL = 0x00000040,       // creature kill not provide XP
    CREATURE_FLAG_EXTRA_INVISIBLE = 0x00000080,       // creature is always invisible for player (mostly trigger creatures)
    CREATURE_FLAG_EXTRA_NOT_TAUNTABLE = 0x00000100,       // creature is immune to taunt auras and effect attack me
    CREATURE_FLAG_EXTRA_AGGRO_ZONE = 0x00000200,       // creature sets itself in combat with zone on aggro
    CREATURE_FLAG_EXTRA_GUARD = 0x00000400,       // creature is a guard
    CREATURE_FLAG_EXTRA_NO_CALL_ASSIST = 0x00000800,       // creature shouldn't call for assistance on aggro
    CREATURE_FLAG_EXTRA_ACTIVE = 0x00001000,       // creature is active object. Grid of this creature will be loaded and creature set as active
    CREATURE_FLAG_EXTRA_MMAP_FORCE_ENABLE = 0x00002000,       // creature is forced to use MMaps
    CREATURE_FLAG_EXTRA_MMAP_FORCE_DISABLE = 0x00004000,       // creature is forced to NOT use MMaps
    CREATURE_FLAG_EXTRA_WALK_IN_WATER = 0x00008000,       // creature is forced to walk in water even it can swim
    CREATURE_FLAG_EXTRA_HAVE_NO_SWIM_ANIMATION = 0x00010000,       // we have to not set "swim" animation or creature will have "no animation"
};

struct Cell;
class Map;
namespace battle::object
{

	class Creature : public battle::object::Unit
	{
	public:
		bool IsPet() const { return true; }
		mt::CreatureInfo* GetCreatureInfo() const { return nullptr; }
        bool HasStaticDBSpawnData() const { return true; };
        void GetRespawnCoord(float& x, float& y, float& z, float* ori = NULL, float* dist = NULL) const {};
        void SetCurrentCell(Cell const& cell) { }
        Cell const& GetCurrentCell() const { return m_currentCell; }
        virtual bool CanSwim() const override { return true; }
        virtual bool CanFly() const override { return false; }
        bool IsFlying() const { return false; }
        bool IsFreeFlying() const { return false; }
        bool IsSwimming() const { return false; }
        bool LoadFromDB(unsigned int guidlow, Map* map) { return true; }
        void SetRespawnTime(unsigned int respawn) { m_respawnTime = respawn ? (unsigned int)time(NULL) + respawn : 0; }
        unsigned int GetRespawnDelay() const { return 0; }
        bool IsWorldBoss() const { return false; }
    private:
        Cell m_currentCell;
        unsigned int m_respawnTime = 0;
	};

}